﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace DotNetAgent.Core
{
	[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
	public class AgentService : IAgentService
	{
		public AgentMessage Recv(AgentMessage p_Msg)
		{
			Console.Out.WriteLine(p_Msg.Sender + " --" + p_Msg.Body as string + "--> " + p_Msg.Recipient);
			return null;
		}

		//public void Recv(AgentMessage p_Msg)
		//{
		//    if (p_Msg == null)
		//    {
		//        throw new ArgumentNullException("Msg");
		//    }
		//    Recv(p_Msg.FromAgent + " " + p_Msg.FromAddress);
		//}

		//public void Recv(List<AgentMessage> p_Msgs)
		//{
		//    if (p_Msgs == null)
		//    {
		//        throw new ArgumentNullException("Msgs");
		//    }
		//    foreach (AgentMessage l_Msg in p_Msgs)
		//    {
		//        Recv(l_Msg);
		//    }
		//}
	}
}
